package com.youi.shop.commons.result;

import lombok.Getter;


@Getter
public enum StatusCode {
    SUCCESS(200, "成功"),
    USERNAME_UNMATCHED_ERROR(41001, "用户不存在"),
    LOGIN_ERROR(41002, "用户名或密码错误"),
    REGISTER_ERROR(41003, "用户名已存在"),
    VALIDATION_ERROR(44444, "校验异常"),
    PARAM_FAIL_CODE(44445, "参数异常"),
    ADDRESS_NULL_ERROR(41010, "地址信息为空"),
    ADDRESS_INSERT_ERROR(41011, "地址信息添加失败"),
    ADDRESS_UPDATE_ERROR(41012, "地址信息修改失败"),
    ADDRESS_DELETE_ERROR(41013, "地址信息删除失败"),
    PRODUCT_INSERT_ERROR(41021, "商品信息添加失败"),
    PRODUCT_UPDATE_ERROR(41022, "商品信息修改失败"),
    PRODUCT_DETELE_ERROR(41023, "商品信息删除失败"),
    CART_INSERT_ERROR(41031, "购物车添加失败"),
    CART_UPDATE_ERROR(41032, "购物车修改失败"),
    CART_DELETE_ERROR(41033, "购物车删除失败"),
    CART_CLEAR_ERROR(41034, "购物车清空失败"),
    CART_NULL_ERROR(41035, "购物车清空失败"),
    CART_NOTFOUND_ERROR(41035, "查询不到该购物车信息"),
    UNDERSTOCK_ERROR(41041, "购买数量大于商品库存"),
    SYS_ERROR(40001, "系统异常"),
    SERVICE_ERROR(404, "服务异常");

    private int status;
    private String message;

    StatusCode(int status, String message) {
        this.status = status;
        this.message = message;
    }


    public int getStatus() {
        return status;
    }


    public String getMessage() {
        return message;
    }
}
